package pCloud.client;

import pCloud.PCloudFactory;
import pCloud.config.PCloudConfig;
import pCloud.service.ProtocolHandle;
import pCloud.transport.Communicator;
import pCloud.transport.EndPointTransportHandle;
import pCloud.transport.TransportHandle;

public class DataOwnerCloudConnector extends Connector {

	public DataOwnerCloudConnector(String host, int port, Communicator comm) throws Exception {
		super(host, port, comm);
	}

	@Override
	public EndPointTransportHandle getNewClientTransportHandle(String host,
			int port) throws Exception {
		EndPointTransportHandle ep = PCloudFactory
				.getEndPointTransportHandle(PCloudConfig
						.getString(PCloudConfig.PCLOUD_TRANSPORT_CLIENT));
		ep.initalize(host, port);
		return ep;
	}

	@Override
	public ProtocolHandle getNewProtocolHandle() throws InstantiationException,
			IllegalAccessException, ClassNotFoundException {
		return PCloudFactory.getNewProtocolHandleInstance(PCloudConfig
				.getString(PCloudConfig.PCLOUD_DATA_OWNER_PROT));
	}

	
}
